package inits

import (
	"github.com/spf13/viper"
	"log"
	"zg6/o2-o-takeaway-backend-system/common/global"
)

func InitViper() {
	viper.SetConfigFile("./dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	err = viper.Unmarshal(&global.Nacos)
	if err != nil {
		panic(err)
	}
	log.Println("viper init success")
}
